<div class="modal" ng-controller="CreateNewDecisionTableCtrl">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header"><h2>{{'DECISION-TABLE.POPUP.CREATE-TITLE' | translate}}</h2></div>
      <div class="modal-body">
        <p>{{'DECISION-TABLE.POPUP.CREATE-DESCRIPTION' | translate}}</p>
        <div class="alert error" ng-if="model.errorMessage && model.errorMessage.length > 0"
             style="font-size: 14px; margin-top:20px">
          <div class="popup-error" style="font-size: 14px">
            <span class="glyphicon glyphicon-remove-circle"></span>
            <span>{{model.errorMessage}}</span>
          </div>
        </div>
        <div class="form-group">
          <label for="newDecisionTableName">{{'DECISION-TABLE.NAME' | translate}}</label>
          <input auto-focus class="form-control" custom-keys editor-input-check
                 enter-pressed="ok()" id="newDecisionTableName" maxlength="400" ng-disabled="model.loading"
                 ng-model="model.decisionTable.name" type="text">
        </div>
        <div class="form-group">
          <label for="newDecisionTableKey">{{'DECISION-TABLE.KEY' | translate}}</label>
          <input class="form-control" editor-input-check id="newDecisionTableKey" maxlength="255"
                 ng-disabled="model.loading" ng-model="model.decisionTable.key" type="text">
        </div>
        <div class="form-group">
          <label for="newDecisionTableDescription">{{'DECISION-TABLE.DESCRIPTION' | translate}}</label>
          <textarea class="form-control" id="newDecisionTableDescription" ng-disabled="model.loading"
                    ng-model="model.decisionTable.description"
                    rows="5"></textarea>
        </div>
      </div>

      <div class="modal-footer">
        <div class="pull-right">
          <button class="btn btn-sm btn-default" ng-click="cancel()" ng-disabled="model.loading" type="button">
            {{'GENERAL.ACTION.CANCEL' | translate}}
          </button>
          <button class="btn btn-sm btn-default" ng-click="ok()"
                  ng-disabled="model.loading || !model.decisionTable.name || model.decisionTable.name.length == 0 || !model.decisionTable.key || model.decisionTable.key.length == 0"
                  type="button">
            {{'DECISION-TABLE.ACTION.CREATE-CONFIRM' | translate}}
          </button>
        </div>
        <div class="loading pull-right" ng-show="model.loading">
          <div class="l1"></div>
          <div class="l2"></div>
          <div class="l2"></div>
        </div>
      </div>
    </div>
  </div>
</div>
